package com.job.pdd;

import java.util.*;

/**
 * @author angzhijin
 * @Description
 * @create 2022-09-03 3:27 PM
 */
public class Pdd0903 {
    public static void main(String[] args) {
        d(args);
    }

    /**
     * 0%
     */
    public static void d(String[] args) {
        Scanner sc= new Scanner(System.in);
        int n = sc.nextInt();
        int c = sc.nextInt();
        int r = sc.nextInt();
        int[] rank = new int[n+1];
        List<Student> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int id = sc.nextInt();
            int score = sc.nextInt();
            list.add(new Student(id,score));
        }
        list.sort(new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                if (o1.score==o2.score)
                    return o2.id-o1.id;
                return o2.score-o1.score;
            }
        });
        //System.out.println(list);
        //System.out.println(Arrays.toString(rank));
        for (int i = 0; i < n; i++) {
            rank[i+1] = list.get(i).score;
        }
        int m = (int)Math.ceil((double)n/c);
        int dd = (r-1)/c;
        double exp =0;
        for (int i = 0; i < m; i++) {
            int levelSum =0;
            if(i==dd)
                exp += rank[r]*(1.0/m);
            else if(i==m-1 && n%c>0){
                for (int j = 1; j <= n%c; j++) {
                    levelSum += rank[i*c+j];
                }
                exp+= levelSum * (1.0/m) * (1.0/c);
            }else{
                for (int j = 1; j <= c; j++) {
                    levelSum += rank[i*c+j];
                }
                exp+= levelSum * (1.0/m) * (1.0/c);
            }
        }
        System.out.println(String.format("%.2f", exp));
    }

    public static class Student{
        int id;
        int score;
        Student(int id, int score){
            this.id =id;
            this.score = score;
        }

        @Override
        public String toString() {
            return id+"-"+score;
        }
    }


}
